Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

Distribute mac arm release #817

Closed

Conversation

nitrocode
Copy link
Contributor

Original PR #793 and ticket #792

In the original PR, I added --universal to pack:mac:mas and pack:mac:masdev and added target pack:mac:arm64 but I forgot to publish these binaries.

After looking at the windows arm pr #667, it looks like updating the release.yml and maybe the build.yml github actions ?

Would appreciate help on this if time permits.

cc: @Hinton @cscharf

@cscharf cscharf requested review from Hinton and joseph-flinn March 30, 2021 20:09
Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we would like to add the arm build to build.yml as well (for master branch).

@joseph-flinn
Copy link
Contributor

Yes, we would want to add the arm build to the build.yml for both the master and rc branches (if: github.ref != 'refs/heads/master' || github.ref == 'refs/heads/rc') as well as an asset upload in both the build.yml and release.yml workflows. I would just follow the upload patterns in the respective workflows.

@dia3olik
Copy link

dia3olik commented May 9, 2021

This will be a godsend since Intel binaries under Rosetta 2 are currently eating ram A LOT...

@AnggaSP
Copy link

AnggaSP commented May 28, 2021

I've managed to run Bitwarden as arm64 build locally and based on light testing, there's no apparent breakage on my M1 MBP.

Here's how I do it:
set npm_config_arch and npm_config_target_arch to arm64 (I'm not sure if cross compilation is possible).
build.

The resulting build is arm64 only unfortunately, I tried setting it to universal but CMIIW electron hasn't supported that yet.

@lbibass
Copy link

lbibass commented Jun 26, 2021

I've managed to run Bitwarden as arm64 build locally and based on light testing, there's no apparent breakage on my M1 MBP.

Here's how I do it:
set npm_config_arch and npm_config_target_arch to arm64 (I'm not sure if cross compilation is possible).
build.

The resulting build is arm64 only unfortunately, I tried setting it to universal but CMIIW electron hasn't supported that yet.

I have been unable to get it to compile on my M1 due to some dependencies missing, mainly LZMA-native. I can't compile it any further.

npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@16.4.0 | darwin | arm64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/Users/lbibass/git/desktop/node_modules/lzma-native/binding-v6.0.1-n-api-darwin-arm64/lzma_native.node" (not found)
npm ERR! node-pre-gyp http GET https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp http 404 https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for lzma-native@6.0.1 and node@16.4.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz

@AnggaSP
Copy link

AnggaSP commented Jun 27, 2021

I've managed to run Bitwarden as arm64 build locally and based on light testing, there's no apparent breakage on my M1 MBP.
Here's how I do it:
set npm_config_arch and npm_config_target_arch to arm64 (I'm not sure if cross compilation is possible).
build.
The resulting build is arm64 only unfortunately, I tried setting it to universal but CMIIW electron hasn't supported that yet.

I have been unable to get it to compile on my M1 due to some dependencies missing, mainly LZMA-native. I can't compile it any further.

npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@16.4.0 | darwin | arm64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/Users/lbibass/git/desktop/node_modules/lzma-native/binding-v6.0.1-n-api-darwin-arm64/lzma_native.node" (not found)
npm ERR! node-pre-gyp http GET https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp http 404 https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for lzma-native@6.0.1 and node@16.4.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz

You may want to try building everything from source

npm_config_build_from_source

@lbibass
Copy link

lbibass commented Jun 27, 2021

I've managed to run Bitwarden as arm64 build locally and based on light testing, there's no apparent breakage on my M1 MBP.
Here's how I do it:
set npm_config_arch and npm_config_target_arch to arm64 (I'm not sure if cross compilation is possible).
build.
The resulting build is arm64 only unfortunately, I tried setting it to universal but CMIIW electron hasn't supported that yet.

I have been unable to get it to compile on my M1 due to some dependencies missing, mainly LZMA-native. I can't compile it any further.

npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@16.4.0 | darwin | arm64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/Users/lbibass/git/desktop/node_modules/lzma-native/binding-v6.0.1-n-api-darwin-arm64/lzma_native.node" (not found)
npm ERR! node-pre-gyp http GET https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp http 404 https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for lzma-native@6.0.1 and node@16.4.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v6.0.1-n-api-darwin-arm64.tar.gz

You may want to try building everything from source

npm_config_build_from_source

It still fails.

1834 error gyp ERR! build error
1834 error gyp ERR! stack Error: `make` failed with exit code: 2
1834 error gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
1834 error gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
1834 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
1834 error gyp ERR! System Darwin 20.5.0
1834 error gyp ERR! command "/opt/homebrew/Cellar/node/16.4.0/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/lbibass/git/desktop/node_modules/lzma-native/binding-v6.0.1-n-api-darwin-arm64/lzma_native.node" "--module_name=lzma_native" "--module_path=/Users/lbibass/git/desktop/node_modules/lzma-native/binding-v6.0.1-n-api-darwin-arm64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
1834 error gyp ERR! cwd /Users/lbibass/git/desktop/node_modules/lzma-native
1834 error gyp ERR! node -v v16.4.0
1834 error gyp ERR! node-gyp -v v7.1.2
1834 error gyp ERR! not ok
1834 error node-pre-gyp ERR! build error
1834 error node-pre-gyp ERR! stack Error: Failed to execute '/opt/homebrew/Cellar/node/16.4.0/bin/node /opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/lbibass/git/desktop/node_modules/lzma-native/binding-v6.0.1-n-api-darwin-arm64/lzma_native.node --module_name=lzma_native --module_path=/Users/lbibass/git/desktop/node_modules/lzma-native/binding-v6.0.1-n-api-darwin-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
1834 error node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/lbibass/git/desktop/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
1834 error node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
1834 error node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
1834 error node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
1834 error node-pre-gyp ERR! System Darwin 20.5.0
1834 error node-pre-gyp ERR! command "/opt/homebrew/Cellar/node/16.4.0/bin/node" "/Users/lbibass/git/desktop/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
1834 error node-pre-gyp ERR! cwd /Users/lbibass/git/desktop/node_modules/lzma-native
1834 error node-pre-gyp ERR! node -v v16.4.0
1834 error node-pre-gyp ERR! node-pre-gyp -v v0.11.0
1834 error node-pre-gyp ERR! not ok
1835 verbose exit 1```

@Hinton
Copy link
Member

Hinton commented Jun 28, 2021

@lbibass Try compiling with Node 14. The last error log only provides a stacktrace of node-gyp calling make, there are probably more detailed errors somewhere in the build logs which should help you trace down the root cause.

@lbibass
Copy link

lbibass commented Jun 29, 2021

@lbibass Try compiling with Node 14. The last error log only provides a stacktrace of node-gyp calling make, there are probably more detailed errors somewhere in the build logs which should help you trace down the root cause.

I managed to get it working, but now it fails at notarizing. Any ideas on how to get around that?

@cscharf
Copy link
Contributor

cscharf commented Jun 29, 2021

I managed to get it working, but now it fails at notarizing. Any ideas on how to get around that?

It depends what error you're getting, however you likely won't be able to notarize it because your machine identifier and Apple developer profile/certificates are not authorized to do so for our package identifier (which is a good thing 😉 ). Are you getting a technical error or authorization error? You could also locally modify the build action to exclude notarization. You can also use the masdev build which I don't believe uses notarization.

@lbibass
Copy link

lbibass commented Jun 30, 2021

I managed to get it working, but now it fails at notarizing. Any ideas on how to get around that?

It depends what error you're getting, however you likely won't be able to notarize it because your machine identifier and Apple developer profile/certificates are not authorized to do so for our package identifier (which is a good thing 😉 ). Are you getting a technical error or authorization error? You could also locally modify the build action to exclude notarization. You can also use the masdev build which I don't believe uses notarization.

I've now done the masdev build, but now I get this error when trying to open the built app.

image

@fdelucchijr
Copy link

I managed to get it working, but now it fails at notarizing. Any ideas on how to get around that?

It depends what error you're getting, however you likely won't be able to notarize it because your machine identifier and Apple developer profile/certificates are not authorized to do so for our package identifier (which is a good thing 😉 ). Are you getting a technical error or authorization error? You could also locally modify the build action to exclude notarization. You can also use the masdev build which I don't believe uses notarization.

I've now done the masdev build, but now I get this error when trying to open the built app.

image

And if you use an chmod 777 Bitwarden.app 🤔

@Hinton
Copy link
Member

Hinton commented Jul 1, 2021

To sign and run masdev you'll need a provisioning profile valid for your device se https://www.electron.build/code-signing#how-to-export-certificate-on-macos.

The easiest way to just run it with npm run electron. If you need a distributed version, I seem to remember the dmg version (npm run dist:mac:dmg) being the easiest to run (once allowed by GateKeeper). The code signing can be disabled by following the steps at https://www.electron.build/code-signing#how-to-disable-code-signing-during-the-build-process-on-macos

@AnggaSP
Copy link

AnggaSP commented Sep 17, 2021

Any update from the team on this PR? Anything blocking from preventing this to be work on?

@lbibass
Copy link

lbibass commented Sep 17, 2021

Any update from the team on this PR? Anything blocking from preventing this to be work on?

The app store already has a Universal Binary

@Hinton
Copy link
Member

Hinton commented Mar 24, 2022

Hi @nitrocode,

Since 1.30 we now publish a universal dmg build on GitHub and our website. I believe this solves the original issue raised in this PR, and I will therefore close it.

Thanks for the contribution, and apologies that it took a while for us to address this.

@Hinton Hinton closed this Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants